import { inject, observer } from 'mobx-react';
import {toJS} from 'mobx';
import React from 'react';
import { Button } from 'antd';
import { WeaTop,WeaRightMenu } from 'ecCom';

@inject('templateStore')
@observer
export default class Template extends React.Component {

	constructor(props) {
		super(props);

	}
	
	render() {
		const {btns,rightMenus} = this.props.templateStore;
		return (
			<div style={{height:'100%'}}>
				<WeaRightMenu 
					datas={toJS(this.getRightMenu())} >

					<WeaTop
						title={"编辑"}
						icon={<i className='icon-coms-lcontract' />}
						iconBgcolor='#217346'
						buttons={[<Button type='primary' onClick={()=>this.submit()}>提交</Button>]}
					>
						<iframe src={"/spa/contract/office.html?mRecordID=4031_3729&mFileName=dcm2.doc&mFileType=.doc&mEditType=1"} ref="webOffice"  className="flowFrame" frameborder="0" width="100%" height="100%" />

					</WeaTop>
				</WeaRightMenu>
			</div>
		)

	}

	getRightMenu(){

		const {menus} = this.props.templateStore;

		return menus;
	}

	submit(){
		let ckref = this.refs.webOffice.contentWindow.SaveDocument();
		//let ckref1 = this.refs.webOffice.contentWindow.WebSaveVersion();
		
	}
}

